﻿@model myFinance.Models.SubGrupoDespesa
@{
	ViewBag.Title = "Cadastro de Sub-Grupo de Despesa";
}
<!DOCTYPE html>
<html>
<head>
    <title>CadastroSubGrupo</title>
    @if (false)
    {
        <script type="text/javascript" src="../../Scripts/jquery-1.6.4-vsdoc.js"></script>
        <script type="text/javascript" src="../../Scripts/jquery.validate-vsdoc.js"></script>
        <script type="text/javascript" src="../../Scripts/jquery.validate.js"></script>
        <script type="text/javascript" src="../../Scripts/numbers.js"></script>
        <script type="text/javascript" src="../../Scripts/script.js"></script>
    }    
    <style type="text/css">
        #corpo
        {
            height: 500px;
            margin: auto;
            width: 900px;
            padding: 0;
        }
        #Nome
        {
            width: 400px;
        }
        #GrupoDespesaId
        {
            width: 410px;
        }
    </style>
</head>
<body>
    <div id="corpo">
        @using (Html.BeginForm("CadastroSubGrupo", "GrupoDespesa", FormMethod.Post))
        {
            @Html.ValidationSummary(true)
            @Html.HiddenFor(model => model.Id)
    
            <div class="editor-label">
                @Html.LabelFor(model => model.Nome, "Nome do Sub-Grupo: ")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Nome, new { @class = "obrigatorio" })
                @Html.ValidationMessageFor(model => model.Nome)
            </div>
    
            <div class="editor-label">
                @Html.LabelFor(model => model.GrupoDespesaId, "Grupo de Despesas: ")
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(model => model.GrupoDespesaId, (IEnumerable<SelectListItem>)ViewBag.Grupo, string.Empty, new { @class = "obrigatorio" })
                @Html.ValidationMessageFor(model => model.GrupoDespesaId)
            </div>
    
            <div class="editor-field" style="float: right; padding-right: 235px; margin-top: 15px;">
                <input type="submit" value="Gravar" />
                <input type="button" value="Cancelar" id="cancelar" />
            </div>
        }
        </div>
        <script type="text/javascript">
            $(function () {
                loadPage();
                hideLoading();
                $('#Nome').focus();
            });            
            $('#cancelar').click(function () {
            	showLoading();
            	window.location.href = '@Url.Action("Index", "GrupoDespesa")';
            });
		</script>
</body>
</html>
